home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '93 / Papers '93 / Macintosh as Internet Server ƒ / inetd / Libraries / myBuildProgram < prev    next >
Encoding:
Text File  |  1993-01-26  |  1.9 KB  |  73 lines  |  [TEXT/MPS ]

  1. #    BuildProgram - build the specified program
  2. #
  3. #    Usage:
  4. #        BuildProgram program [options…] > log
  5. #
  6. #    The BuildProgram script builds the specified program (or target).
  7. #    A simple transcript of the build is written to standard output.
  8. #
  9. #    Make is used to generate the build commands.  If file <program>.make
  10. #    exists it is used as the makefile.    If not, file MakeFile is used.
  11. #
  12. #    The options specified are passed directly to Make, and control the
  13. #    generation of the build commands.
  14. #
  15. #
  16. #    Copyright Apple Computer, Inc. 1987 - 1992
  17. #    All rights reserved.
  18.  
  19. Set Exit 1
  20.  
  21. #    Find the program parameter.
  22.  
  23. Unset program
  24. For i In {"Parameters"}
  25.     If "{i}" !~ /-≈/
  26.         Set program "{i}"
  27.         Break
  28.     End
  29. End
  30. If "{program}" == ""
  31.     Set program "default"
  32. End
  33.  
  34. #    Select the makefile.
  35.  
  36. Set makefile "`Exists Makefile`"
  37.  
  38. If "{makefile}" == ""
  39.     Set makefile `(Files -t TEXT "{program}".make || ∂
  40.         Files -t TEXT MakeFile || Echo '""') ≥ Dev:Null`
  41. End
  42.  
  43. If "{makefile}" == ""
  44.     Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
  45.     Exit 1
  46. End
  47.  
  48. #    Run Make, then execute its output.
  49.  
  50. Echo "# `Date -t` ----- Build of {program}."
  51. Echo "# `Date -t` ----- Analyzing dependencies."
  52. Begin
  53.     Echo "Set Echo 1"
  54.     Make {"Parameters"} -f "{makefile}"
  55. End > "{program}".makeout
  56. Echo "# `Date -t` ----- Executing build commands."
  57. "{program}".makeout
  58. Delete "{program}".makeout
  59. Echo "# `Date -t` ----- Done."
  60. Set type "`files -i -n -x t "{program}" ≥ Dev:Null || Set Status 0`"
  61. Set CaseSensitive True #filetype check for DA must be case sensitive
  62. If "{type}" =~ /≈ APPL/ OR "{type}" =~ /≈ MPST/     # application or tool
  63.     Echo -n ∂t; Quote -n "{program}"; Echo -n " "
  64. Else If "{type}" =~ /≈ DFIL/                        # desk accessory in Suitcase
  65.     Echo -n ∂t
  66.     Quote -n "Font/DA Mover" "{SystemFolder}"System "{program}";
  67.     Echo -n "  # Install DA"
  68. Else If "{type}" =~ /≈ dfil/                        # desk accessory (System 7)
  69.     Echo -n ∂t
  70.     Quote -n Duplicate -y "{program}" "{SystemFolder}Apple Menu Items";
  71.     Echo -n "  # Install DA into Apple Menu"
  72. End
  73.